package com.ikas.ai.server.module.flow.enums;

/**
 * @Description: 断言符号
 * @Author: qi.yilai
 * @Date: 2023/2/7 19:03
 * @Version: 1.0.0
 **/
public enum LogicSymbol {

    AND("&&", "and"),

    OR("||", "or");

    private String symbol;

    private String code;

    LogicSymbol(String symbol, String code) {
        this.symbol = symbol;
        this.code = code;
    }

    public String getSymbol() {
        return symbol;
    }

    public void setSymbol(String symbol) {
        this.symbol = symbol;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public static LogicSymbol of(String code) {
        for (LogicSymbol logicSymbol : LogicSymbol.values()) {
            if (logicSymbol.getCode().equals(code)) {
                return logicSymbol;
            }
        }
        return null;
    }
}
